import { createApp } from 'vue'
import { createRouter, createWebHashHistory } from 'vue-router'
import App from './App.vue'
import TechSupport from './components/TechSupport.vue'
import PrivacyPolicy from './components/PrivacyPolicy.vue'
import PetInsurance from './components/PetInsurance.vue'
import PetRescue from './components/PetRescue.vue'
import VirtualPetGame from './components/VirtualPetGame.vue'

// 创建路由实例
const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      // 使用一个简单的首页组件，这里暂时使用App的主要内容
      component: {
        template: '<div class="flex flex-col min-h-screen">\n          <!-- 首页内容将通过App.vue中的条件渲染显示 -->\n        </div>'
      },
      alias: '/home'
    },
    {
      path: '/tech-support',
      component: TechSupport
    },
    {
      path: '/privacy-policy',
      component: PrivacyPolicy
    },
    {
      path: '/pet-insurance',
      component: PetInsurance
    },
    {
      path: '/pet-rescue',
      component: PetRescue
    },
    {
      path: '/virtual-pet-game',
      component: VirtualPetGame
    }
  ]
})

// 创建Vue应用实例
const app = createApp(App)

// 使用路由
app.use(router)

// 挂载应用
app.mount('#app')